Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation update for Ability to resolve with "nothing" #396

Closed
wants to merge 3 commits into from

Conversation

sakuntala-motukuri
Copy link
Contributor

@sakuntala-motukuri sakuntala-motukuri commented Jun 24, 2024

Documentation update for Ability to resolve with "nothing"

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Comment on lines 37 to 41
### Improvements

The AsyncNodePluginPlugin class is now capable of handling the below :
- The resolvedMapping map now sets the node.id as the key and either parsedNode or node as the value, depending on whether parsedNode is truthy.
- This means that the plugin is now capable of resolving the async node even when the consumer returns a null/undefined value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than document the implementation details, can we document what it enables? Maybe something like:

Suggested change
### Improvements
The AsyncNodePluginPlugin class is now capable of handling the below :
- The resolvedMapping map now sets the node.id as the key and either parsedNode or node as the value, depending on whether parsedNode is truthy.
- This means that the plugin is now capable of resolving the async node even when the consumer returns a null/undefined value.
### Edge cases
If for some reason, the process for resolving some `AsyncNode` fails, or is no longer relevant, you can resolve the promise for that `AsyncNode` with `undefined` or `null` to replace that node with "nothing"...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to document the implementation changes, you should put those in the release notes for this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we are actually returning the existing node itself instead of nothing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example for adding release notes:
#296 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be more intentional about the use case, rather than stating this to be a fallback option of sort

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a question to me or @sugarmanz ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both, right now it's framed as a fallback option, I'm thinking we make this more intentional because i'm thinking about the future node removal work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's covered with:

or is no longer relevant

But we could have an explicit use case around using async node to power toasts, or something like that.

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (1f3b30a) to head (3a6643e).

Additional details and impacted files
@@           Coverage Diff            @@
##           bazel-6     #396   +/-   ##
========================================
  Coverage    91.82%   91.82%           
========================================
  Files          339      339           
  Lines        27007    27007           
  Branches      1956     1956           
========================================
  Hits         24799    24799           
  Misses        2195     2195           
  Partials        13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sakuntala-motukuri
Copy link
Contributor Author

Pushing this to backlog as a collective decision has been made that this will be done after all the related iterations are in , so closing this as of now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants